
from socket import *
ADDR = ("127.0.0.1",8888)

tcp = socket(AF_INET,SOCK_STREAM)

tcp.connect(ADDR)

while True:
    msg = input(">>:")
    if not msg:
        continue
    if msg == "q":
        break
    tcp.send(msg.encode())
    data = tcp.recv(1024)
    print(data.decode())
tcp.close()